
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Proposal for extended Vi tags file format &#8212; Universal Ctags 0.3.0 documentation</title>
    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '0.3.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true,
        SOURCELINK_SUFFIX: '.txt'
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Who we are" href="developers.html" />
    <link rel="prev" title="Relationship between other projects" href="other-projects.html" /> 
  </head>
  <body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="developers.html" title="Who we are"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="other-projects.html" title="Relationship between other projects"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Universal Ctags 0.3.0 documentation</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="proposal-for-extended-vi-tags-file-format">
<h1>Proposal for extended Vi tags file format<a class="headerlink" href="#proposal-for-extended-vi-tags-file-format" title="Permalink to this headline">¶</a></h1>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The contents of next section is a copy of FORMAT file in exuberant
ctags source code in its subversion repository at sourceforge.net.
I(Masatake YAMATO) changed only its format in the most of all
parts.  I added a subsection for showing the position of universal
ctags.</p>
</div>
<div class="contents local topic" id="table-of-contents">
<p class="topic-title first"><cite>Table of contents</cite></p>
<ul class="simple">
<li><a class="reference internal" href="#introduction" id="id1">Introduction</a></li>
<li><a class="reference internal" href="#from-proposal-to-standard" id="id2">From proposal to standard</a></li>
<li><a class="reference internal" href="#backwards-compatibility" id="id3">Backwards compatibility</a></li>
<li><a class="reference internal" href="#security" id="id4">Security</a></li>
<li><a class="reference internal" href="#goals" id="id5">Goals</a></li>
<li><a class="reference internal" href="#proposal" id="id6">Proposal</a></li>
<li><a class="reference internal" href="#universal-ctags" id="id7">Universal ctags</a><ul>
<li><a class="reference internal" href="#exceptions" id="id8">Exceptions</a></li>
<li><a class="reference internal" href="#compatible-output-and-weakness" id="id9">Compatible output and weakness</a></li>
</ul>
</li>
</ul>
</div>
<hr class="docutils" />
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Version:</th><td class="field-body">0.06 DRAFT</td>
</tr>
<tr class="field-even field"><th class="field-name">Date:</th><td class="field-body">1998 Feb 8</td>
</tr>
<tr class="field-odd field"><th class="field-name">Author:</th><td class="field-body">Bram Moolenaar &lt;Bram at vim.org&gt; and Darren Hiebert &lt;dhiebert at users.sourceforge.net&gt;</td>
</tr>
</tbody>
</table>
<div class="section" id="introduction">
<h2><a class="toc-backref" href="#id1">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
<p>The file format for the “tags” file, as used by Vi and many of its
descendants, has limited capabilities.</p>
<p>This additional functionality is desired:</p>
<ol class="arabic simple">
<li>Static or local tags.
The scope of these tags is the file where they are defined.  The same tag
can appear in several files, without really being a duplicate.</li>
<li>Duplicate tags.
Allow the same tag to occur more then once.  They can be located in
a different file and/or have a different command.</li>
<li>Support for C++.
A tag is not only specified by its name, but also by the context (the
class name).</li>
<li>Future extension.
When even more additional functionality is desired, it must be possible to
add this later, without breaking programs that don’t support it.</li>
</ol>
</div>
<div class="section" id="from-proposal-to-standard">
<h2><a class="toc-backref" href="#id2">From proposal to standard</a><a class="headerlink" href="#from-proposal-to-standard" title="Permalink to this headline">¶</a></h2>
<p>To make this proposal into a standard for tags files, it needs to be supported
by most people working on versions of Vi, ctags, etc..  Currently this
standard is supported by:</p>
<dl class="docutils">
<dt>Darren Hiebert &lt;dhiebert at users.sourceforge.net&gt;</dt>
<dd>Exuberant ctags</dd>
<dt>Bram Moolenaar &lt;Bram at vim.org&gt;</dt>
<dd>Vim (Vi IMproved)</dd>
</dl>
<p>These have been or will be asked to support this standard:</p>
<dl class="docutils">
<dt>Nvi</dt>
<dd>Keith Bostic &lt;bostic at bsdi.com&gt;</dd>
<dt>Vile</dt>
<dd>Tom E. Dickey &lt;dickey at clark.net&gt;</dd>
<dt>NEdit</dt>
<dd>Mark Edel &lt;edel at ltx.com&gt;</dd>
<dt>CRiSP</dt>
<dd>Paul Fox &lt;fox at crisp.demon.co.uk&gt;</dd>
<dt>Lemmy</dt>
<dd>James Iuliano &lt;jai at accessone.com&gt;</dd>
<dt>Zeus</dt>
<dd>Jussi Jumppanen &lt;jussij at ca.com.au&gt;</dd>
<dt>Elvis</dt>
<dd>Steve Kirkendall &lt;kirkenda at cs.pdx.edu&gt;</dd>
<dt>FTE</dt>
<dd>Marko Macek &lt;Marko.Macek at snet.fri.uni-lj.si&gt;</dd>
</dl>
</div>
<div class="section" id="backwards-compatibility">
<h2><a class="toc-backref" href="#id3">Backwards compatibility</a><a class="headerlink" href="#backwards-compatibility" title="Permalink to this headline">¶</a></h2>
<p>A tags file that is generated in the new format should still be usable by Vi.
This makes it possible to distribute tags files that are usable by all
versions and descendants of Vi.</p>
<p>This restricts the format to what Vi can handle.  The format is:</p>
<ol class="arabic">
<li><p class="first">The tags file is a list of lines, each line in the format:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">{</span><span class="n">tagname</span><span class="p">}</span><span class="o">&lt;</span><span class="n">Tab</span><span class="o">&gt;</span><span class="p">{</span><span class="n">tagfile</span><span class="p">}</span><span class="o">&lt;</span><span class="n">Tab</span><span class="o">&gt;</span><span class="p">{</span><span class="n">tagaddress</span><span class="p">}</span>
</pre></div>
</div>
<dl class="docutils">
<dt>{tagname}</dt>
<dd><p class="first">Any identifier, not containing white space..</p>
<p class="last">EXCEPTION: Universal ctags violates this item of the proposal;
tagname may contain spaces. However, tabs are not allowed.</p>
</dd>
<dt>&lt;Tab&gt;</dt>
<dd><p class="first last">Exactly one TAB character (although many versions of Vi can
handle any amount of white space).</p>
</dd>
<dt>{tagfile}</dt>
<dd><p class="first last">The name of the file where {tagname} is defined, relative to
the current directory (or location of the tags file?).</p>
</dd>
<dt>{tagaddress}</dt>
<dd><p class="first last">Any Ex command.  When executed, it behaves like ‘magic’ was
not set.</p>
</dd>
</dl>
</li>
<li><p class="first">The tags file is sorted on {tagname}.  This allows for a binary search in
the file.</p>
</li>
<li><p class="first">Duplicate tags are allowed, but which one is actually used is
unpredictable (because of the binary search).</p>
</li>
</ol>
<p>The best way to add extra text to the line for the new functionality, without
breaking it for Vi, is to put a comment in the {tagaddress}.  This gives the
freedom to use any text, and should work in any traditional Vi implementation.</p>
<p>For example, when the old tags file contains:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>main    main.c  /^main(argc, argv)$/
DEBUG   defines.c       89
</pre></div>
</div>
<p>The new lines can be:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>main    main.c  /^main(argc, argv)$/;&quot;any additional text
DEBUG   defines.c       89;&quot;any additional text
</pre></div>
</div>
<p>Note that the ‘;’ is required to put the cursor in the right line, and then
the ‘”’ is recognized as the start of a comment.</p>
<p>For Posix compliant Vi versions this will NOT work, since only a line number
or a search command is recognized.  I hope Posix can be adjusted.  Nvi suffers
from this.</p>
</div>
<div class="section" id="security">
<h2><a class="toc-backref" href="#id4">Security</a><a class="headerlink" href="#security" title="Permalink to this headline">¶</a></h2>
<p>Vi allows the use of any Ex command in a tags file.  This has the potential of
a trojan horse security leak.</p>
<p>The proposal is to allow only Ex commands that position the cursor in a single
file.  Other commands, like editing another file, quitting the editor,
changing a file or writing a file, are not allowed.  It is therefore logical
to call the command a tagaddress.</p>
<p>Specifically, these two Ex commands are allowed:</p>
<ul>
<li><p class="first">A decimal line number:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="mi">89</span>
</pre></div>
</div>
</li>
<li><p class="first">A search command.  It is a regular expression pattern, as used by Vi,
enclosed in // or ??:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>/^int c;$/
?main()?
</pre></div>
</div>
</li>
</ul>
<p>There are two combinations possible:</p>
<ul>
<li><p class="first">Concatenation of the above, with ‘;’ in between.  The meaning is that the
first line number or search command is used, the cursor is positioned in
that line, and then the second search command is used (a line number would
not be useful).  This can be done multiple times.  This is useful when the
information in a single line is not unique, and the search needs to start
in a specified line.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">/</span><span class="n">struct</span> <span class="n">xyz</span> <span class="p">{</span><span class="o">/</span><span class="p">;</span><span class="o">/</span><span class="nb">int</span> <span class="n">count</span><span class="p">;</span><span class="o">/</span>
<span class="mi">389</span><span class="p">;</span><span class="o">/</span><span class="n">struct</span> <span class="n">foo</span><span class="o">/</span><span class="p">;</span><span class="o">/</span><span class="n">char</span> <span class="o">*</span><span class="n">s</span><span class="p">;</span><span class="o">/</span>
</pre></div>
</div>
</li>
<li><p class="first">A trailing comment can be added, starting with ‘;”’ (two characters:
semi-colon and double-quote).  This is used below.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="mi">89</span><span class="p">;</span><span class="s2">&quot; foo bar</span>
</pre></div>
</div>
</li>
</ul>
<p>This might be extended in the future.  What is currently missing is a way to
position the cursor in a certain column.</p>
</div>
<div class="section" id="goals">
<h2><a class="toc-backref" href="#id5">Goals</a><a class="headerlink" href="#goals" title="Permalink to this headline">¶</a></h2>
<p>Now the usage of the comment text has to be defined.  The following is aimed
at:</p>
<ol class="arabic simple">
<li>Keep the text short, because:<ul>
<li>The line length that Vi can handle is limited to 512 characters.</li>
<li>Tags files can contain thousands of tags.  I have seen tags files of
several Mbytes.</li>
<li>More text makes searching slower.</li>
</ul>
</li>
<li>Keep the text readable, because:<ul>
<li>It is often necessary to check the output of a new ctags program.</li>
<li>Be able to edit the file by hand.</li>
<li>Make it easier to write a program to produce or parse the file.</li>
</ul>
</li>
<li>Don’t use special characters, because:<ul>
<li>It should be possible to treat a tags file like any normal text file.</li>
</ul>
</li>
</ol>
</div>
<div class="section" id="proposal">
<h2><a class="toc-backref" href="#id6">Proposal</a><a class="headerlink" href="#proposal" title="Permalink to this headline">¶</a></h2>
<p>Use a comment after the {tagaddress} field.  The format would be:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">{</span><span class="n">tagname</span><span class="p">}</span><span class="o">&lt;</span><span class="n">Tab</span><span class="o">&gt;</span><span class="p">{</span><span class="n">tagfile</span><span class="p">}</span><span class="o">&lt;</span><span class="n">Tab</span><span class="o">&gt;</span><span class="p">{</span><span class="n">tagaddress</span><span class="p">}[;</span><span class="s2">&quot;&lt;Tab&gt;</span><span class="si">{tagfield}</span><span class="s2">..]</span>
</pre></div>
</div>
<dl class="docutils">
<dt>{tagname}</dt>
<dd><p class="first">Any identifier, not containing white space..</p>
<p class="last">EXCEPTION: Universal ctags violates this item of the proposal;
name may contain spaces. However, tabs are not allowed.
Conversion, for some characters including &lt;Tab&gt; in the “value”,
explained in the last of this section is applied.</p>
</dd>
<dt>&lt;Tab&gt;</dt>
<dd>Exactly one TAB character (although many versions of Vi can
handle any amount of white space).</dd>
<dt>{tagfile}</dt>
<dd>The name of the file where {tagname} is defined, relative to
the current directory (or location of the tags file?).</dd>
<dt>{tagaddress}</dt>
<dd>Any Ex command.  When executed, it behaves like ‘magic’ was
not set.  It may be restricted to a line number or a search
pattern (Posix).</dd>
</dl>
<p>Optionally:</p>
<dl class="docutils">
<dt>;”</dt>
<dd>semicolon + doublequote: Ends the tagaddress in way that looks
like the start of a comment to Vi.</dd>
<dt>{tagfield}</dt>
<dd>See below.</dd>
</dl>
<p>A tagfield has a name, a colon, and a value: “name:value”.</p>
<ul>
<li><p class="first">The name consist only out of alphabetical characters.  Upper and lower case
are allowed.  Lower case is recommended.  Case matters (“kind:” and “Kind:
are different tagfields).</p>
</li>
<li><p class="first">The value may be empty.
It cannot contain a &lt;Tab&gt;.</p>
<ul class="simple">
<li>When a value contains a “\t”, this stands for a &lt;Tab&gt;.</li>
<li>When a value contains a “\r”, this stands for a &lt;CR&gt;.</li>
<li>When a value contains a “\n”, this stands for a &lt;NL&gt;.</li>
<li>When a value contains a “\”, this stands for a single ‘' character.</li>
</ul>
<p>Other use of the backslash character is reserved for future expansion.
Warning: When a tagfield value holds an MS-DOS file name, the backslashes
must be doubled!</p>
<p>EXCEPTION: Universal ctags introduces more conversion rules.</p>
<ul class="simple">
<li>When a value contains a “\a”, this stands for a &lt;BEL&gt; (0x07).</li>
<li>When a value contains a “\b”, this stands for a &lt;BS&gt; (0x08).</li>
<li>When a value contains a “\v”, this stands for a &lt;VT&gt; (0x0b).</li>
<li>When a value contains a “\f”, this stands for a &lt;FF&gt; (0x0c).</li>
<li>The characters in range 0x01 to 0x1F included, 0x7F, and leading space
(0x20) and ‘!’ (0x21) are converted to x prefixed hexadecimal number if
the characters are not handled in the above “value” rules.</li>
</ul>
</li>
</ul>
<p>Proposed tagfield names:</p>
<table border="1" class="docutils">
<colgroup>
<col width="16%" />
<col width="84%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">FIELD-NAME</th>
<th class="head">DESCRIPTION</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>arity</td>
<td>Number of arguments for a function tag.</td>
</tr>
<tr class="row-odd"><td>class</td>
<td>Name of the class for which this tag is a member or method.</td>
</tr>
<tr class="row-even"><td>enum</td>
<td>Name of the enumeration in which this tag is an enumerator.</td>
</tr>
<tr class="row-odd"><td>file</td>
<td>Static (local) tag, with a scope of the specified file.  When
the value is empty, {tagfile} is used.</td>
</tr>
<tr class="row-even"><td>function</td>
<td>Function in which this tag is defined.  Useful for local
variables (and functions).  When functions nest (e.g., in
Pascal), the function names are concatenated, separated with
‘/’, so it looks like a path.</td>
</tr>
<tr class="row-odd"><td>kind</td>
<td><p class="first">Kind of tag.  The value depends on the language.  For C and
C++ these kinds are recommended:</p>
<dl class="docutils">
<dt>c</dt>
<dd>class name</dd>
<dt>d</dt>
<dd>define (from #define XXX)</dd>
<dt>e</dt>
<dd>enumerator</dd>
<dt>f</dt>
<dd>function or method name</dd>
<dt>F</dt>
<dd>file name</dd>
<dt>g</dt>
<dd>enumeration name</dd>
<dt>m</dt>
<dd>member (of structure or class data)</dd>
<dt>p</dt>
<dd>function prototype</dd>
<dt>s</dt>
<dd>structure name</dd>
<dt>t</dt>
<dd>typedef</dd>
<dt>u</dt>
<dd>union name</dd>
<dt>v</dt>
<dd>variable</dd>
</dl>
<p class="last">When this field is omitted, the kind of tag is undefined.</p>
</td>
</tr>
<tr class="row-even"><td>struct</td>
<td>Name of the struct in which this tag is a member.</td>
</tr>
<tr class="row-odd"><td>union</td>
<td>Name of the union in which this tag is a member.</td>
</tr>
</tbody>
</table>
<p>Note that these are mostly for C and C++.  When tags programs are written for
other languages, this list should be extended to include the used field names.
This will help users to be independent of the tags program used.</p>
<p>Examples:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>asdf    sub.cc  /^asdf()$/;&quot;    new_field:some\svalue   file:
foo_t   sub.h   /^typedef foo_t$/;&quot;     kind:t
func3   sub.p   /^func3()$/;&quot;   function:/func1/func2   file:
getflag sub.c   /^getflag(arg)$/;&quot;      kind:f  file:
inc     sub.cc  /^inc()$/;&quot;     file: class:PipeBuf
</pre></div>
</div>
<p>The name of the “kind:” field can be omitted.  This is to reduce the size of
the tags file by about 15%.  A program reading the tags file can recognize the
“kind:” field by the missing ‘:’.  Examples:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>foo_t   sub.h   /^typedef foo_t$/;&quot;     t
getflag sub.c   /^getflag(arg)$/;&quot;      f       file:
</pre></div>
</div>
<p>Additional remarks:</p>
<ul class="simple">
<li>When a tagfield appears twice in a tag line, only the last one is used.</li>
</ul>
<p>Note about line separators:</p>
<p>Vi traditionally runs on Unix systems, where the line separator is a single
linefeed character &lt;NL&gt;.  On MS-DOS and compatible systems &lt;CR&gt;&lt;NL&gt; is the
standard line separator.  To increase portability, this line separator is also
supported.</p>
<p>On the Macintosh a single &lt;CR&gt; is used for line separator.  Supporting this on
Unix systems causes problems, because most fgets() implementation don’t see
the &lt;CR&gt; as a line separator.  Therefore the support for a &lt;CR&gt; as line
separator is limited to the Macintosh.</p>
<p>Summary:</p>
<table border="1" class="docutils">
<colgroup>
<col width="23%" />
<col width="36%" />
<col width="41%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">line separator</th>
<th class="head">generated on</th>
<th class="head">accepted on</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>&lt;LF&gt;</td>
<td>Unix</td>
<td>Unix, MS-DOS, Macintosh</td>
</tr>
<tr class="row-odd"><td>&lt;CR&gt;</td>
<td>Macintosh</td>
<td>Macintosh</td>
</tr>
<tr class="row-even"><td>&lt;CR&gt;&lt;LF&gt;</td>
<td>MS-DOS</td>
<td>Unix, MS-DOS, Macintosh</td>
</tr>
</tbody>
</table>
<p>The characters &lt;CR&gt; and &lt;LF&gt; cannot be used inside a tag line.  This is not
mentioned elsewhere (because it’s obvious).</p>
<p>Note about white space:</p>
<p>Vi allowed any white space to separate the tagname from the tagfile, and the
filename from the tagaddress.  This would need to be allowed for backwards
compatibility.  However, all known programs that generate tags use a single
&lt;Tab&gt; to separate fields.</p>
<p>There is a problem for using file names with embedded white space in the
tagfile field.  To work around this, the same special characters could be used
as in the new fields, for example “\s”.  But, unfortunately, in MS-DOS the
backslash character is used to separate file names.  The file name
“c:\vim\sap” contains “\s”, but this is not a &lt;Space&gt;.  The number of
backslashes could be doubled, but that will add a lot of characters, and make
parsing the tags file slower and clumsy.</p>
<p>To avoid these problems, we will only allow a &lt;Tab&gt; to separate fields, and
not support a file name or tagname that contains a &lt;Tab&gt; character.  This
means that we are not 100% Vi compatible.  However, there is no known tags
program that uses something else than a &lt;Tab&gt; to separate the fields.  Only
when a user typed the tags file himself, or made his own program to generate a
tags file, we could run into problems.  To solve this, the tags file should be
filtered, to replace the arbitrary white space with a single &lt;Tab&gt;.  This Vi
command can be used:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">:</span><span class="o">%</span><span class="n">s</span><span class="o">/^</span>\<span class="p">([</span><span class="o">^</span> <span class="o">^</span><span class="n">I</span><span class="p">]</span><span class="o">*</span>\<span class="p">)[</span> <span class="o">^</span><span class="n">I</span><span class="p">]</span><span class="o">*</span>\<span class="p">([</span><span class="o">^</span> <span class="o">^</span><span class="n">I</span><span class="p">]</span><span class="o">*</span>\<span class="p">)[</span> <span class="o">^</span><span class="n">I</span><span class="p">]</span><span class="o">*/</span>\<span class="mi">1</span><span class="o">^</span><span class="n">I</span>\<span class="mi">2</span><span class="o">^</span><span class="n">I</span><span class="o">/</span>
</pre></div>
</div>
<p>(replace ^I with a real &lt;Tab&gt;).</p>
<p>TAG FILE INFORMATION:</p>
<p>Psuedo-tag lines can be used to encode information into the tag file regarding
details about its content (e.g. have the tags been sorted?, are the optional
tagfields present?), and regarding the program used to generate the tag file.
This information can be used both to optimize use of the tag file (e.g.
enable/disable binary searching) and provide general information (what version
of the generator was used).</p>
<p>The names of the tags used in these lines may be suitably chosen to ensure
that when sorted, they will always be located near the first lines of the tag
file.  The use of “!_TAG_” is recommended.  Note that a rare tag like “!”
can sort to before these lines.  The program reading the tags file should be
smart enough to skip over these tags.</p>
<p>The lines described below have been chosen to convey a select set of
information.</p>
<p>Tag lines providing information about the content of the tag file:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>!_TAG_FILE_FORMAT   {version-number}        /optional comment/
!_TAG_FILE_SORTED   {0|1}                   /0=unsorted, 1=sorted/
</pre></div>
</div>
<p>The {version-number} used in the tag file format line reserves the value of
“1” for tag files complying with the original UNIX vi/ctags format, and
reserves the value “2” for tag files complying with this proposal. This value
may be used to determine if the extended features described in this proposal
are present.</p>
<p>Tag lines providing information about the program used to generate the tag
file, and provided solely for documentation purposes:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>!_TAG_PROGRAM_AUTHOR        {author-name}   /{email-address}/
!_TAG_PROGRAM_NAME  {program-name}  /optional comment/
!_TAG_PROGRAM_URL   {URL}   /optional comment/
!_TAG_PROGRAM_VERSION       {version-id}    /optional comment/
</pre></div>
</div>
</div>
<div class="section" id="universal-ctags">
<h2><a class="toc-backref" href="#id7">Universal ctags</a><a class="headerlink" href="#universal-ctags" title="Permalink to this headline">¶</a></h2>
<p>Universal ctags supports this proposal with some
exceptions.</p>
<div class="section" id="exceptions">
<h3><a class="toc-backref" href="#id8">Exceptions</a><a class="headerlink" href="#exceptions" title="Permalink to this headline">¶</a></h3>
<ol class="arabic simple">
<li>{tagname} in tags file generated by Universal ctags may contain
spaces and several escape sequences. Parsers for documents like Tex and
reStructuredText, or liberal languages such as JavaScript need these
exceptions. See {tagname} of Proposal section for more detail about the
conversion.</li>
</ol>
</div>
<div class="section" id="compatible-output-and-weakness">
<span id="compat-output"></span><h3><a class="toc-backref" href="#id9">Compatible output and weakness</a><a class="headerlink" href="#compatible-output-and-weakness" title="Permalink to this headline">¶</a></h3>
<p>Default behavior (<code class="docutils literal"><span class="pre">--output-format=u-ctags</span></code> option) has the
exceptions.  In other hand, with <code class="docutils literal"><span class="pre">--output-format=e-ctags</span></code> option
ctags has no exception; Universal-ctags command may use the same file
format as Exuberant-ctags. However, <code class="docutils literal"><span class="pre">--output-format=e-ctags</span></code> throws
away a tag entry which name includes a space or a tab
character. <code class="docutils literal"><span class="pre">TAG_OUTPUT_MODE</span></code> pseudo tag tells which format is
used when ctags generating tags file.</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Proposal for extended Vi tags file format</a><ul>
<li><a class="reference internal" href="#introduction">Introduction</a></li>
<li><a class="reference internal" href="#from-proposal-to-standard">From proposal to standard</a></li>
<li><a class="reference internal" href="#backwards-compatibility">Backwards compatibility</a></li>
<li><a class="reference internal" href="#security">Security</a></li>
<li><a class="reference internal" href="#goals">Goals</a></li>
<li><a class="reference internal" href="#proposal">Proposal</a></li>
<li><a class="reference internal" href="#universal-ctags">Universal ctags</a><ul>
<li><a class="reference internal" href="#exceptions">Exceptions</a></li>
<li><a class="reference internal" href="#compatible-output-and-weakness">Compatible output and weakness</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="other-projects.html"
                        title="previous chapter">Relationship between other projects</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="developers.html"
                        title="next chapter">Who we are</a></p>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="developers.html" title="Who we are"
             >next</a> |</li>
        <li class="right" >
          <a href="other-projects.html" title="Relationship between other projects"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Universal Ctags 0.3.0 documentation</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2015, Universal Ctags Team.
      Last updated on 19 Dec 2017.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.4.
    </div>
  </body>
</html>